feat: 50% decrease Nuget Android part in MAUI #469
Conversation
trufflehog — Issues FoundThe trufflehog security scan found issues on commit |
…servability is not initialized or when a session replay already exists, adding logging for clarity.
1295c7c to
8d7564c
Compare
…/ld-android2 * andrey/silent-otlp-exceptions-in-e2e-tests: silence otlp connection exceptions in e2e tests
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ed2e570. Configure here.
beekld
left a comment
There was a problem hiding this comment.
This seems fine for now.
I think it would be cleaner to separate these into separate libraries eventually, so that we don't have special build config just for MAUI.
It's a shame the other LD SDK is so large. I wonder if we can reduce that, such that this isn't an issue. I'll bring it up with the SDK team.
My only real concern is the unit test failing. Approving on the assumption you get that test working.
* main: fix: [SDK-2197] manually register main Activity with session replay (#475)
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-observability-android: 0.40.0</summary> ## [0.40.0](launchdarkly-observability-android-0.39.0...launchdarkly-observability-android-0.40.0) (2026-04-18) ### Features * 50% decrease Nuget Android part in MAUI ([#469](#469)) ([83d49af](83d49af)) </details> <details><summary>session-replay-react-native: 0.4.1</summary> ## [0.4.1](session-replay-react-native-0.4.0...session-replay-react-native-0.4.1) (2026-04-18) ### Bug Fixes * [SDK-2197] manually register main Activity with session replay ([#475](#475)) ([75fd6e7](75fd6e7)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). [SDK-2197]: https://launchdarkly.atlassian.net/browse/SDK-2197?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Release bookkeeping only (version bumps + changelog entries) with no functional code changes in this PR. Risk is limited to publishing/packaging metadata being incorrect. > > **Overview** > Updates release metadata to publish new SDK versions: bumps `@launchdarkly/observability-android` to `0.40.0` (including `gradle.properties` and changelog entry) and `@launchdarkly/session-replay-react-native` to `0.4.1` (package version + changelog). > > Also updates `.release-please-manifest.json` to reflect these new release versions. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e9bc365. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->

Summary
Decouples the Observability and Session Replay SDKs from the LaunchDarkly Android Client SDK (
LDClient), making them independently launchable without requiringLDClientat runtime.Motivation
The MAUI / .NET binding only needs observability and session replay — it never uses
LDClientfor feature flags. Previously, the observability SDK was tightly coupled to the client SDK throughPlugin/Hookbase classes,LDLogger,LDContext, andLDLogAdapter. This forced the MAUI build to bundle the entire client SDK and its transitive dependencies (jackson, timber, launchdarkly-logging) even though none of them were used.Dependency cleanup
build.gradle.kts:launchdarkly-android-client-sdkiscompileOnlywhen built from the MAUI composite build (isIncludedByMaui),implementationotherwise.timberdependency entirely (no longer used in source).NativeAndroidDeps.props(MAUI NuGet bundle):launchdarkly-android-client-sdk-*.aartimber-*.aarjackson-*.jarlaunchdarkly-*.jarTest plan
LDObserve.init(application, mobileKey, ldContext, options, replayOptions)initializes observability and session replay withoutLDClientObservabilityandSessionReplayplugins still work when registered viaLDConfig.Builder.plugins()dotnet buildproduces a NuGet without LDClient AAR, timber, jackson, or launchdarkly JARs./gradlew :lib:testDebugUnitTestrealInit()andrealFlagInit()pathsNote
Medium Risk
Moderate risk due to decoupling from
LDClient(new context/logging abstractions and new init path) which changes initialization and session replay identify behavior; dependency/build changes could affect consumers and packaging.Overview
Adds a standalone initialization path via
LDObserve.init(application, mobileKey, ldContext, options, replayOptions)that can start observability and optionally session replay without the LaunchDarkly feature-flag SDK.Replaces
LDContext/LDLogger/LDLogAdapterusage with new lightweightLDObserveContextandObserveLogger/ObserveLogAdapter(defaulting to AndroidLog), and updates session replay identify payloads to use this context plus an explicitcanonicalKeyOverride.Updates the .NET MAUI Android bridge and packaging to use the standalone init and drop bundling
LDClient/timber/jackson artifacts, including build logic to depend on the client SDK only ascompileOnlywhen included by MAUI; E2E tests are hardened with per-test teardown (LDClient.close()/mock server shutdown) and log assertions that tolerate init-timeLD.identifynoise.Reviewed by Cursor Bugbot for commit 6ad6a88. Bugbot is set up for automated code reviews on this repo. Configure here.